package org.dyyx.nrest.rest.mapping;

import java.lang.reflect.Method;

import org.dyyx.nrest.annotation.PostMapping;


public final class PostMappingRegisterStrategy extends AbstractRequestMappingRegisterStrategy implements RequestMappingRegisterStrategy {
    
   
    @Override
    public String getMethodUrl(Method method) {
        if(method.getAnnotation(PostMapping.class) != null) {
            return method.getAnnotation(PostMapping.class).value();
        }
        return "";
    }

  
    @Override
    public String getHttpMethod() {
        return "POST";
    }
    
  
    @Override
    public void registerMapping(String url, ControllerMapping mapping) {
        ControllerMappingRegistry.getPostMappings().put(url, mapping);
    }

}
